package com.rj.core.validation.constraints;


import com.rj.core.validation.BetweenValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

/***
 * 不在范围内
 * @author YFX_RANLUBO
 * @date 2022/10/25 18:00
  */
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
@Repeatable(Between.List.class)
@Documented
@Constraint(
    validatedBy = {BetweenValidator.class}
)
public @interface Between {
    String message() default "{label}必须{min}~{max}之间";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    double max();

    double min();
    /**
     * 标签名
     */
    String value();

    @Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
    @Retention(RetentionPolicy.RUNTIME)
    @Documented
    public @interface List {
        Between[] value();
    }
}